home *** CD-ROM | disk | FTP | other *** search
- C.S.M.P. Digest Fri, 29 May 92 Volume 1 : Issue 99
-
- Today's Topics:
-
- Prototyping problems THINK C 5.0.2?
- 4-byte ints & ThinkC library
- Modeless dialogs with THINK Pascal
- Buy second monitor or CD-ROM?
- StdPutFile Patch
- GlobalToLocal() help?
- good way to relocate cursor?
- TCL - DITL/DLOG - how to use?
- UDP Broadcasts w/ MacTCP 1.1
- Position of SFGetFile dialog, sys6 vs. sys7
- Mac Serial Programming
- Calling XCMDs from normal code (Pascal particularly!)
-
-
- The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
-
- These digests are available (by using FTP, account anonymous, your email
- address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
- edu. This is also the home of the comp.sys.mac.programmer Frequently Asked
- Questions list. The last several issues of the digest are available from
- sumex-aim.stanford.edu as well.
-
- These digests are also available via email. Just send a note saying that you
- want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
- automatically receive each new digest as it is created.
-
- The digest is a collection of articles from the internet newsgroup comp.sys.
- mac.programmer. It is designed for people who read c.s.m.p. semi-regularly
- and want an archive of the discussions. If you don't know what a newsgroup
- is, you probably don't have access to it. Ask your systems administrator(s)
- for details. (This means you can't post questions to the digest.)
-
- The articles in these digests are taken directly from comp.sys.mac.programmer.
- They are not edited; all articles included in this digest are in their original
- posted form. The only articles that are -not- included in these digests are
- those which didn't receive any replies (except those that give information
- rather than ask a question). All replies to each article are concatenated
- onto the original article in the order in which they were received. Article
- threads are not added to the digests until the last article added to the
- thread is at least one month old (this is to ensure that the thread is dead
- before adding it to the digests).
-
- Send administrative mail to mkelly@cs.uoregon.edu.
-
- -------------------------------------------------------
-
- From: alen@crash.cts.com (Alen Shapiro)
- Subject: Prototyping problems THINK C 5.0.2?
- Date: 20 Apr 92 01:42:58 GMT
- Organization: Crash TimeSharing, El Cajon, CA
-
- Using Think C 5.0.2, trying to port APM (arbitrary precision math) package
- (from TC 4.0 where it works just fine). If I set "require prototypes" OR
- uncheck "check pointer types" the following code compiles. If I check
- "check pointer types" and either uncheck "strict prototype inforcement" OR
- set "infer prototypes", I get an invalid redeclaration.
-
- Any takers on this one? Chances are I'm being really stupid and will
- end up with egg all over my face (again).
-
- Is it possible that "infer prototypes" or non-strict prototyping
- mean that prototypes are illegal if found? (back to the manual)
-
- - --alen
- alen@crash.cts.com
- - -------------put this in a .c file and compile---fails even if typedef used---
- int apm_init(long, int, short);
-
- int
- apm_init(ainit, ascaleFactor, abase)
- long ainit;
- int ascaleFactor;
- short abase; {
- }
-
- +++++++++++++++++++++++++++
-
- From: huntley@garbo.cs.indiana.edu (Haydn Huntley)
- Date: 20 Apr 92 04:41:51 GMT
- Organization: Indiana University, Bloomington
-
- In article <1992Apr20.014258.10070@crash.cts.com> alen@crash.cts.com (Alen Shapiro) writes:
- >Using Think C 5.0.2, trying to port APM (arbitrary precision math) package
- >(from TC 4.0 where it works just fine). If I set "require prototypes" OR
- >uncheck "check pointer types" the following code compiles. If I check
- >"check pointer types" and either uncheck "strict prototype inforcement" OR
- >set "infer prototypes", I get an invalid redeclaration.
- >
- >Any takers on this one? Chances are I'm being really stupid and will
- >end up with egg all over my face (again).
- >
- >Is it possible that "infer prototypes" or non-strict prototyping
- >mean that prototypes are illegal if found? (back to the manual)
- >
- >--alen
- >alen@crash.cts.com
- >-------------put this in a .c file and compile---fails even if typedef used---
- >int apm_init(long, int, short);
- >
- >int
- >apm_init(ainit, ascaleFactor, abase)
- > long ainit;
- > int ascaleFactor;
- > short abase; {
- >}
-
- I think the solution to this problem is to convert the above old-style
- C function definition, to the new ANSI style, like this:
-
- int
- apm_init(long ainit, int ascaleFactor, short abase)
- {
- }
-
- It would be a pain to have to convert alot of code like this by hand,
- but Think C 5.0 comes with an application named PrototypeHelper, which
- you should find in your Think C/Utilities folder.
-
- I think it would be more intelligent if Think C would accept both old
- and ANSI style definitions, regardless of the settings of those
- compiler switches! Turbo C on the PC does! :-)
-
- - --Haydn
- - --
- ;; *****************************************************
- ;; * Haydn Huntley huntley@copper.ucs.indiana.edu *
- ;; *****************************************************
-
- +++++++++++++++++++++++++++
-
- From: russotto@eng.umd.edu (Matthew T. Russotto)
- Date: Mon, 20 Apr 92 12:49:18 GMT
- Organization: College of Engineering, University of Maryland, College Park
-
- In article <1992Apr20.014258.10070@crash.cts.com> alen@crash.cts.com (Alen Shapiro) writes:
-
- >"check pointer types" and either uncheck "strict prototype inforcement" OR
- >set "infer prototypes", I get an invalid redeclaration.
-
- >-------------put this in a .c file and compile---fails even if typedef used---
- >int apm_init(long, int, short);
- >
- >int
- >apm_init(ainit, ascaleFactor, abase)
- > long ainit;
- > int ascaleFactor;
- > short abase; {
- >}
-
- The combination of the prototype and the old-style declaration appear
- to be confusing THINK C. Try going to new-style declarations, i.e.
-
- apm_init(long ainit, int ascaleFactor, short abase)
- {
- }
-
- I found that "Check Pointer Types" had no effect.
- - --
- Matthew T. Russotto russotto@eng.umd.edu russotto@wam.umd.edu
- Some news readers expect "Disclaimer:" here.
- Just say NO to police searches and seizures. Make them use force.
- (not responsible for bodily harm resulting from following above advice)
-
- +++++++++++++++++++++++++++
-
- From: alen@crash.cts.com (Alen Shapiro)
- Date: 20 Apr 92 15:43:26 GMT
- Organization: Crash TimeSharing, El Cajon, CA
-
- In <1992Apr19.234156.19798@news.cs.indiana.edu> huntley@garbo.cs.indiana.edu (Haydn Huntley) writes:
-
- >In article <1992Apr20.014258.10070@crash.cts.com> alen@crash.cts.com (Alen Shapiro) writes:
-
- description of failure modes for code below deleted
-
- >>int apm_init(long, int, short);
- >>
- >>int
- >>apm_init(ainit, ascaleFactor, abase)
- >> long ainit;
- >> int ascaleFactor;
- >> short abase; {
- >>}
-
- >I think the solution to this problem is to convert the above old-style
- >C function definition, to the new ANSI style, like this:
-
- >int
- >apm_init(long ainit, int ascaleFactor, short abase)
- >{
- >}
-
- >It would be a pain to have to convert alot of code like this by hand,
- >but Think C 5.0 comes with an application named PrototypeHelper, which
- >you should find in your Think C/Utilities folder.
-
- >I think it would be more intelligent if Think C would accept both old
- >and ANSI style definitions, regardless of the settings of those
- >compiler switches! Turbo C on the PC does! :-)
-
- You are right! Certainly seems to work. I did want my code to be easily
- portable back to a non-ansi C (like the brain-damaged Sun compiler, where
- the price is right, Non-ANSI is free, $2000 for ANSI.)
-
- I'd hate to have to "#ifdef sun" every function declaration containing
- a short, char or float but I guess I'll have to.
-
- thanks. And thanks to everyone else who took the trouble to reply.
- - --alen
-
- +++++++++++++++++++++++++++
-
- From: Dale_Semchishen@mindlink.bc.ca (Dale Semchishen)
- Date: 22 Apr 92 06:36:42 GMT
- Organization: MIND LINK! - British Columbia, Canada
-
- > Alen Shapiro writes:
- >
- >
- > I'd hate to have to "#ifdef sun" every function declaration containing
- > a short, char or float but I guess I'll have to.
- >
-
-
- A good technique for writing portable code is to #define or
- typedef all of your data types in an "environment" include file.
- For example:
-
- #define CHAR char
- typedef char CHAR
-
- That way when you have to port to a different environment or
- compiler all you have to is the "environment" include file.
-
-
- - --
- Dale Semchishen | Internet: Dale_Semchishen@mindlink.bc.ca
- Personal Designs Inc. | tel: (604) 590-0056
- | Vancouver, BC, Canada
-
- +++++++++++++++++++++++++++
-
- From: hull@ibmb0.cs.uiuc.edu (David Hull)
- Organization: University of Illinois at Urbana-Champaign
- Date: Thu, 23 Apr 1992 07:08:23 GMT
-
- alen@crash.cts.com (Alen Shapiro) writes:
-
- >Using Think C 5.0.2, trying to port APM (arbitrary precision math) package
- >(from TC 4.0 where it works just fine). If I set "require prototypes" OR
- >uncheck "check pointer types" the following code compiles. If I check
- >"check pointer types" and either uncheck "strict prototype inforcement" OR
- >set "infer prototypes", I get an invalid redeclaration.
-
- His code:
-
- >int apm_init(long, int, short);
-
- >int
- >apm_init(ainit, ascaleFactor, abase)
- > long ainit;
- > int ascaleFactor;
- > short abase; {
- >}
-
- Your prototype is incorrect. It should be:
-
- int apm_init(long, int, int);
-
- So Think C is absolutely right in telling you that you are redeclaring
- the function definition.
-
- The prototype apm_init(long, int, short) tells the compiler to only
- pass a short to the function. Using the old-style definition,
-
- apm_init(ainit, ascaleFactor, abase)
- long ainit; int ascaleFactor; short; abase;
-
- , the calling routine promotes the third parameter to an int before
- calling apm_init, and then apm_init converts it back to a short.
-
- - -David
-
- +++++++++++++++++++++++++++
-
- From: jimc@isc-br.ISC-BR.COM (Jim Cathey)
- Date: 27 Apr 92 22:04:44 GMT
- Organization: ISC-Bunker Ramo, An Olivetti Company
-
- In article <1992Apr23.070823.7045@sunb10.cs.uiuc.edu> David Hull <hull@cs.uiuc.edu> writes:
- >>(from TC 4.0 where it works just fine). If I set "require prototypes" OR
- >>uncheck "check pointer types" the following code compiles. If I check
- >>"check pointer types" and either uncheck "strict prototype inforcement" OR
- >>set "infer prototypes", I get an invalid redeclaration.
- >>
- >>int apm_init(long, int, short);
- >>int
- >>apm_init(ainit, ascaleFactor, abase)
- >> long ainit;
- >> int ascaleFactor;
- >> short abase; {
- >>}
- >
- >Your prototype is incorrect. It should be:
- >
- > int apm_init(long, int, int);
- >
- >So Think C is absolutely right in telling you that you are redeclaring
- >the function definition.
-
- However, there are those of us who insist that ANSI was _wrong_ to
- mandate such behavior, and who think the rule should be "The prototype
- is always right." In other words, the function definition should be in
- "Live with it, Jack" mode, and if it sees (via the prototype) that it's
- getting passed the correct type to do nothing, and if it's only getting
- passed a flibble instead of a flubble, that it should insert the same
- 'as-if assignment' type promotion that it already knows how to do. It
- should be possible to have the best of all possible worlds: Prototypes,
- efficient calling sequences, and code that will still compile in a
- non-ANSI environment (by #ifdef-ing out the prototypes, which can all
- be in one header file).
-
- +----------------+
- ! II CCCCCC ! Jim Cathey
- ! II SSSSCC ! ISC-Bunker Ramo
- ! II CC ! TAF-C8; Spokane, WA 99220
- ! IISSSS CC ! UUCP: uunet!isc-br!jimc (jimc@isc-br.isc-br.com)
- ! II CCCCCC ! (509) 927-5757
- +----------------+
- "PC's --- the junk bonds of the computer industry"
-
- ---------------------------
-
- From: wong_a@summer.chem.su.oz.au
- Subject: 4-byte ints & ThinkC library
- Organization: School of Chemistry, University of Sydney
- Date: Wed, 29 Apr 1992 01:26:53 GMT
-
-
- What's a good workaround for using the ThinkC Standard Library with
- 4-byte ints, i.e. in some routines it expects a "short" but the
- prototype in the header has "int", and the compiler will ensure the
- routine gets a 4-byte int. For example, this won't work,
-
- char buff[100];
- memset(buff,'\0',sizeof(buff));
-
- In this case, memset is sent (long)'\0' instead of (short)'\0'. Short of
- changing the header file by hand, what else can be done?
-
-
- - -----------------------------------------------------------------------------
- Adrian Wong, Dept.of Theoretical Chemistry wong_a@summer.chem.su.oz.au
- University of Sydney NSW 2006 Australia 061-2-692 4137
-
- +++++++++++++++++++++++++++
-
- From: aw0g+@andrew.cmu.edu (Aaron Wohl)
- Date: 28 Apr 92 11:56:28 GMT
- Organization: Special Projects, Carnegie Mellon, Pittsburgh, PA
-
- When useing 4byte ints you need to copy the ansi library to be ansi-int4
- and change it to be 4 byte ints then rebuild. Aaron
-
- +++++++++++++++++++++++++++
-
- From: d88-jwa@dront.nada.kth.se (Jon W{tte)
- Date: 28 Apr 92 12:48:16 GMT
- Organization: Royal Institute of Technology, Stockholm, Sweden
-
-
- wong_a@summer.chem.su.oz.au writes:
-
- What's a good workaround for using the ThinkC Standard Library with
- 4-byte ints, i.e. in some routines it expects a "short" but the
- prototype in the header has "int", and the compiler will ensure the
-
- You could follow the manual's advice and re-compile the ANSI library
- using the supplied project, but with your compiler options set.
- Then name it something bright, like "ANSI 4-byte int" and use it
- instead of "ANSI."
-
- - --
- "You should meet yourself someday. I'm sure you would hate it."
- - - Me: h+@nada.kth.se; Jon W{tte (The Diplomat - NOT!)
-
- ---------------------------
-
- From: umdenbo0@ccu.umanitoba.ca (David A. Denboer)
- Subject: Modeless dialogs with THINK Pascal
- Date: 20 Apr 92 04:09:32 GMT
- Organization: University of Manitoba, Winnipeg, Canada
-
-
- Could someone please mail me information on how to properly program modeless
- dialogs with THINK Pascal?
- My events are not getting caught by my event loop, crashing my program.
- Thanks
-
- umdenbo0@ccu.umanitoba.ca
-
- +++++++++++++++++++++++++++
-
- From: umdenbo0@ccu.umanitoba.ca (David A. Denboer)
- Date: 28 Apr 92 00:28:49 GMT
- Organization: University of Manitoba, Winnipeg, Canada
-
- In <1992Apr20.040932.21469@ccu.umanitoba.ca> umdenbo0@ccu.umanitoba.ca (David A. Denboer) writes:
-
-
- >Could someone please mail me information on how to properly program modeless
- >dialogs with THINK Pascal?
- >My events are not getting caught by my event loop, crashing my program.
- >Thanks
-
- >umdenbo0@ccu.umanitoba.ca
- Thanks to the people who mailed me information about programming dialog boxes
- with Pascal. Source code from ftp.apple.com helped alot too.
- I finally got the damn things working properly with multifinder, and can move
- on to better things (modeless dialogs with THINK C)!
- If anyone out there has a large music collection and would like a small,
- personal data-base for storing their collections, mail me a line and I will
- send my program to you when I am finished testing it.
- I still have bugs to work out with my pop-up-menus so it might be a few weeks.
- Anyway, thanks to all.
-
- umdenbo0@ccu.umanitoba.ca
-
- FREDO DIDN'T REALLY DROWN!
-
- ---------------------------
-
- From: robert@hccwmv2
- Subject: Buy second monitor or CD-ROM?
- Date: 22 Apr 92 07:27:55 PDT
- Organization: Health Care Computer Works, Las Vegas, Nevada
-
- My tax return is coming and I'm thinking of getting either a CD-ROM
- or a second monitor (B&W). I can't make up my mind. The second monitor
- would be great for SADE debugging, but there's a lot of stuff available
- on CDs.
- Any suggestions/opinions?
-
- (Please post replies, email has a problem getting to me sometimes)
-
- Thanks
- - --
- []<>[] Robert Duran Jr. []<>[]
- <>[]<> <nevada.edu:hccwmv2!robert> <>[]<>
- []<>[] []<>[]
-
- +++++++++++++++++++++++++++
-
- From: Jeremiah.Blatz@dartmouth.edu (Jeremiah Blatz)
- Date: 25 Apr 92 21:14:22 GMT
- Organization: Dartmouth College, Hanover, NH
-
- In article <1992Apr22.072756.531@hccwmv2>
- robert@hccwmv2 writes:
-
- > My tax return is coming and I'm thinking of getting either a CD-ROM
- > or a second monitor (B&W). I can't make up my mind. The second monitor
- > would be great for SADE debugging, but there's a lot of stuff available
- > on CDs.
- > Any suggestions/opinions?
-
-
- CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM!
-
-
- You can get d e v e l o p for $27 a year, it includes all Tech. Notes,
- all Inside Mac, and up to the month info. Also MPW libraries, ResEdit,
- MacsBug, and other cool stuff. If you get a NEC CD-Gallery, you get an
- encyclopedia, an atlas, a "Time Table of History", and some less useful
- stuff. You can also play audio CD's. I have a Mac+ (read "9 in.
- screen") and think the CD-Rom drive is worth my aggravations(sp) with
- MPW and SADE.
-
- Jeremiah
-
- +++++++++++++++++++++++++++
-
- From: robert@hccwmv2
- Date: 28 Apr 92 13:55:46 PDT
- Organization: Health Care Computer Works, Las Vegas, Nevada
-
- In article <1992Apr25.211422.16269@dartvax.dartmouth.edu>, Jeremiah.Blatz@dartmouth.edu (Jeremiah Blatz) writes:
- > In article <1992Apr22.072756.531@hccwmv2>
- > robert@hccwmv2 writes:
- >
- >> My tax return is coming and I'm thinking of getting either a CD-ROM
- >> or a second monitor (B&W). I can't make up my mind. The second monitor
- >> would be great for SADE debugging, but there's a lot of stuff available
- >> on CDs.
- >> Any suggestions/opinions?
- >
- >
- > CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM! CD-ROM!
- >
- >
- > You can get d e v e l o p for $27 a year, it includes all Tech. Notes,
- > all Inside Mac, and up to the month info. Also MPW libraries, ResEdit,
- > MacsBug, and other cool stuff. If you get a NEC CD-Gallery, you get an
- > encyclopedia, an atlas, a "Time Table of History", and some less useful
- > stuff. You can also play audio CD's. I have a Mac+ (read "9 in.
- > screen") and think the CD-Rom drive is worth my aggravations(sp) with
- > MPW and SADE.
- >
- > Jeremiah
-
- Great...I was just about settled on a monitor and now this. With the
- d e v e l o p disk, does it come with a utility for reading and searching
- the technical notes? Do you get sample code?
- Which CD Rom do you have? Someone mentioned making sure that any
- CD Rom you buy is QuickTime compatable, how do I make sure?
-
- Geeez, that's a lot of questions, thanks in advance,
- - --
- []<>[] Robert Duran Jr. []<>[]
- <>[]<> <nevada.edu:hccwmv2!robert> <>[]<>
- []<>[] []<>[]
-
- ---------------------------
-
- From: ewylie@ocf.berkeley.edu (Elizabeth Wylie)
- Subject: StdPutFile Patch
- Date: 26 Apr 92 18:49:39 GMT
- Organization: U. C. Berkeley Open Computing Facility
-
-
- For several years I've been waiting for Apple to provide a way to save a file
- w/o the hassle of having to click on the Replace button when asked "Replace
- existing foobar?" When system 7 came around I thought that maybe with all
- of the new shortcuts I could prehaps hold down the option key or something when
- saving so that it would just replace the existing file. No such luck. So I
- broke down and did a little hacking. To make the option key bypass the
- "Replace Existing" dialog, make the following changes using ResEdit. This will
- only work on System 7.0 and 7.1. (And, of course, make the changes on a backup
- copy of the system file).
-
- PACK #3
-
- At offset 9EC change the long word following 'rplc' to $6100 2B2A
- Append the following to the end of the resource:
-
- 1038 0173 0800 0002
- 6700 0006 7D01 4E75
- 61FF FFFF EB74 4E75
-
- That should do it. When ever you click on the save button (or type opt-return)
- the StdFile package will not ask any questions. The option key is not checked
- for at the exact same time as the event is recorded (it is checked for just
- before the dialog is to be brought up). So you may have to hold down the
- option key for a moment in order for it to register on 9 inch macs.
-
- If you have any problems with this (or a better solution) send replys to
- ewylie@ocf.berkeley.edu.
-
- - -Elizabeth Wylie
-
- +++++++++++++++++++++++++++
-
- From: ewylie@ocf.berkeley.edu (Elizabeth Wylie)
- Date: 28 Apr 92 01:43:52 GMT
- Organization: U. C. Berkeley Open Computing Facility
-
-
- I have just been informed of two typos I made in my recent atricle on patching
- pack resource #3. The correct hexidecimal is below. I apologize for any
- crashing, etc. (This is pretty embarassing).
-
- Append to the pack 3 resource in the system file:
-
- 1038 017B 0800 0002 (017B was 0173)
- 6700 0006 7001 4E75 (7001 was 7D01)
- 61FF FFFF EB74 4E75
-
- Definitley time to invest in a pair of glasses.
-
- Again, apologies.
-
- - -Elizabeth Wylie
- .
-
- ---------------------------
-
- From: erik@archimedes.nwc.navy.mil (Erik van bronkhorst)
- Subject: GlobalToLocal() help?
- Date: 27 Apr 92 10:38:38 GMT
- Organization: Naval Weapons Center, China Lake, CA
-
- Environment:
- Sys 7.01 (not 1.1 or 1.1.1)
- Think C 5.01
-
- No matter what, GlobalToLocal seems to have no effect. I have to
- manually offset the position of radio buttons in windows for the
- right one to get selected.
-
- Also, my SfGetFile won't display the "message". SfPutfile does.
-
- Any suggestions will help. Thanks
- - --
- Erik van Bronkhorst KC6UUT erik@rftech.nwc.navy.mil
- DoD#4342585443 AMA#438054 "3.412 squid" "2.5 geezer"
-
- +++++++++++++++++++++++++++
-
- From: keith@taligent.com (Keith Rollin)
- Date: 28 Apr 92 20:48:08 GMT
- Organization: Taligent
-
- In article <1992Apr27.103838.20714@avalon.nwc.navy.mil>,
- erik@archimedes.nwc.navy.mil (Erik van bronkhorst) writes:
- >
- > Also, my SfGetFile won't display the "message". SfPutfile does.
- >
-
- >From Inside Mac I, page 523:
-
- "The prompt parameter is ignored; it's there for historical purposes only."
-
- - --
- Keith Rollin
- Phantom Programmer
- Taligent, Inc.
-
- ---------------------------
-
- From: bruce2@unix.cis.pitt.edu (Bruce A Bollinger)
- Subject: good way to relocate cursor?
- Date: 27 Apr 92 19:05:42 GMT
- Organization: Univ. of Pittsburgh, Comp & Info Sys
-
-
- I have a quick question that I hope someone can help me with. The
- problem being, I want to disallow any cursor movement into a small Rect on the
- screen. Is there some way to force the location of the cursor to remain at
- the boundry until the mouse is moved vertically up or horizontally? I wish no
- flickering of HideCursor and redrawing.
- I saw something simular in the UMPG but the code uses undocumented calls
- and variables. I would like guidance to finding good examples.
-
- Thanks,
- Bruce2@unix.cis.pitt.edu
-
- +++++++++++++++++++++++++++
-
- From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
- Date: 27 Apr 92 21:17:52 GMT
- Organization: Kalamazoo College
-
- bruce2@unix.cis.pitt.edu (Bruce A Bollinger) writes:
- >
- > I have a quick question that I hope someone can help me with. The
- >problem being, I want to disallow any cursor movement into a small Rect on the
- >screen. Is there some way to force the location of the cursor to remain at
- >the boundry until the mouse is moved vertically up or horizontally? I wish no
- >flickering of HideCursor and redrawing.
- > I saw something simular in the UMPG but the code uses undocumented calls
- >and variables. I would like guidance to finding good examples.
-
- There isn't a good way unless you bypass Apple's cursor. You can
- constrain it to a given rectangle by setting certain locations, but it
- breaks on later machines (and later operating systems).
-
- The best method is to hide the real cursor and install your own cursor
- routine as a vertical blanking task. But writing a fast routine for any
- bit depth is no fun. Making it track the real cursor when either (1)
- your tracking area or (2) the union of all attached screens is
- non-rectangular, is not easy, and it's impossible to do it right.
- Process switching would be a UI nightmare, and you don't want to think
- about displaying it on multiple monitors.
-
- So don't constrain the cursor. Let it be free.
-
- It sounds like you're doing animation in a rectangle. Consider using
- ShieldCursor() (IM I-474) or HideCursor() (IM I-168) instead, balanced
- by ShowCursor() when the animation's over.
- - --
- Jamie McCarthy Internet: k044477@kzoo.edu AppleLink: j.mccarthy
- "Also thanks to: Inside Macintosh (except vol. V, ch. 27)"
- - the Tesserae "About..." box
-
- ---------------------------
-
- From: awmin@athena.mit.edu (Art Min)
- Subject: TCL - DITL/DLOG - how to use?
- Date: 29 Apr 92 05:47:55 GMT
- Organization: Massachusetts Institute of Technology
-
- Okay, I need help - I'm trying to implement Dialog Boxes in
- TCL. Okay, I know that there are some classes in the Dialog Classes
- Folder, but I'm not sure how to use tem since they're not in the
- manual for Think C 5.0! I tried to "manually" do them with direct
- calls with the Toolbox but it's not happy.
-
- SO COULD ANYBODY who knows how to call up a DLOG resource and then
- get information from it. I know how to do it "manually", but I need
- a guide through how to use it with TCL.
-
- Thanks a lot!
-
- Please email response - it's easier that way.
-
- Art
-
- awmin@athena.mit.edu
-
-
- - --
- ******************************************************************************
- * Art Min * Learn from the past, Live in the present, *
- * awmin@athena.mit.edu * and hope for the future. *
- ******************************************************************************
-
- +++++++++++++++++++++++++++
-
- From: awmin@athena.mit.edu (Art Min)
- Date: 29 Apr 92 05:57:32 GMT
- Organization: Massachusetts Institute of Technology
-
- Okay, I need help - I'm trying to implement Dialog Boxes in
- TCL. Okay, I know that there are some classes in the Dialog Classes
- Folder, but I'm not sure how to use tem since they're not in the
- manual for Think C 5.0! I tried to "manually" do them with direct
- calls with the Toolbox but it's not happy.
-
- SO COULD ANYBODY who knows how to call up a DLOG resource and then
- get information from it. I know how to do it "manually", but I need
- a guide through how to use it with TCL.
-
- Thanks a lot!
-
- Please email response - it's easier that way.
-
- Art
-
- awmin@athena.mit.edu
-
- - --
- ******************************************************************************
- * Art Min * Learn from the past, Live in the present, *
- * awmin@athena.mit.edu * and hope for the future. *
- ******************************************************************************
-
- ---------------------------
-
- From: hjelm+@cs.cmu.edu (Mark Hjelm)
- Subject: UDP Broadcasts w/ MacTCP 1.1
- Date: Mon, 27 Apr 92 21:29:29 GMT
- Organization: School of Computer Science, Carnegie Mellon
-
-
- I may be missing something obvious, but...
-
- How do I receive UDP broadcast packets with MacTCP 1.1? Sending them
- seems to work fine.
-
- Thanks,
- Mark Hjelm
- hjelm@cs.cmu.edu
-
- +++++++++++++++++++++++++++
-
- From: hjelm+@cs.cmu.edu (Mark Hjelm)
- Date: 28 Apr 92 17:46:07 GMT
- Organization: School of Computer Science, Carnegie Mellon
-
- In article <whatever> I wrote:
- >
- >I may be missing something obvious, but...
- >
- >How do I receive UDP broadcast packets with MacTCP 1.1? Sending them
- >seems to work fine.
- >
-
- I was right. I was missing something obvious, like using a MacTCP
- driver I hadn't trashed. I didn't notice until I tried using telnet,
- since UDP kindof worked. Everything works fine now, in the obvious
- manner. Sigh.
-
-
- Mark Hjelm
- hjelm@cs.cmu.edu
-
- ---------------------------
-
- From: jcr@mbunix.mitre.org (Rogers)
- Subject: Position of SFGetFile dialog, sys6 vs. sys7
- Organization: The MITRE Corporation, Bedford, MA
- Date: Mon, 27 Apr 1992 21:38:57 GMT
-
- I'd like my program to position the SFGetFile (& SFPutFile) dialog nicely
- under both sys6 & sys7. The following code positions it automatically
- under 7:
-
- Point ULCorner ;
- SFTypeList typeList ;
- SFReply sfReply ;
-
- ULCorner.h = 0 ;
- ULCorner.v = 0 ;
- SFGetFile( ULCorner, "\p", (FileFilterProcPtr)0, -1, &typeList,
- (DlgHookProcPtr)0, &sfReply ) ;
-
- But under 6, I have to position it manually by changing the assignment of
- ULCorner to something like the following:
-
- ULCorner.h =
- (screenBits.bounds.left + screenBits.bounds.right - SFDialogWidth)/2 ;
- ULCorner.v =
- (screenBits.bounds.top + screenBits.bounds.bottom - SFDialogHeight)/2 ;
-
- But I don't know how to find "SFDialogWidth" & "SFDialogHeight". I know
- they're stored in the dialog resources (-3999 & -4000) of the system
- file. Is it safe to hard-wire the values given in IM vol.1? Or is there
- a different and better approach?
-
- Can anyone help?
-
- - --- Jeff Rogers
- jcr@mbunix.mitre.org
-
-
- +++++++++++++++++++++++++++
-
- From: U21192@uicvm.uic.edu (John Galidakis)
- Date: 28 Apr 92 02:10:42 GMT
- Organization: University of Illinois at Chicago
-
-
- Yes there IS a way to do this; Just call GetNewDialog instead:
-
-
- GetSelection:=GetNewDialog(-4000,nil,Pointer(-1));
- with ScreenBits.Bounds do
- begin
- ScreenSize.h:=Right-Left;...v:=Bottom-Top;
- end;
- with GetSelection^.PortRect do
- begin
- DialogSize.h:=Right-Left;DialogSize.v:=Bottom-Top;
- end;
- {now prepare the "where of SFGetFile"}
- Where.h:=ScreenSize.h div 2-DialogSize.h div 2;
- ......v:=...........v..................v.......
- TypeList[0]:=whatever;
- SFGetFile(where,'',nil,n,TypeList,nil,Reply);
- - ---------------------------------------------
- The getnewdialog call loads the resources, and SFGetFile actually displays.
- (or so I think)
- John "the Baptist" Galidakis
- Paranoid Evangelist.
- **** "Only JCN won the game with the great Goddess. The rest just tried..."
-
- ---------------------------
-
- From: putzolu@toadflax.cs.ucdavis.edu (David Putzolu)
- Subject: Mac Serial Programming
- Date: 27 Apr 92 23:16:15 GMT
- Organization: Department of Computer Science, University of California, Davis
-
- A friend of mine is doing a project that involves communicating
- over the serial port being synchronized with drawing to the
- screen. He is a fairly experienced programmer,
- but does not know how to do what he wants to on the
- Mac. If anyone could help with the following questions by sending
- him email it would be really great. Thanks!
-
- (His address is harrison@CAESAR.ucdavis.edu)
-
- 1) How is the communications toolbox used? Is the CTB development
- kit really necessary?
- 2) Are there any really good books on programming the serial port
- available, for the CTB or not? Preferably for Think C v.5.
- 3) Are there other ways to time animation without using the Time
- Manager since you cannot call toolbox routines that call the Memory
- Manager (such as drawing routines) from a Time Manager started
- routine?
-
- Thanks again!
-
- | David M. A. Putzolu | putzolu@cs.ucdavis.edu |
- | Senior Undergraduate | op disclaimer(opinion : ptr mine) |
- | Computer Science and Psychology | Aiuto! Sono caduto e |
- | University of California at Davis | non posso alzarmi! |
-
- +++++++++++++++++++++++++++
-
- From: mspace@netcom.com (Brian Hall)
- Date: 27 Apr 92 23:51:46 GMT
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
-
- In article <12731@ucdavis.ucdavis.edu> putzolu@toadflax.cs.ucdavis.edu (David Putzolu) writes:
- >1) How is the communications toolbox used? Is the CTB development
- > kit really necessary?
- >2) Are there any really good books on programming the serial port
- > available, for the CTB or not? Preferably for Think C v.5.
-
- 1- If you have System 7, you could get by with just the Addison Wesley
- book since the CTB is included with Sys7, if not (and perhaps even if you d0)
- you might want to consider the $100 CTB Package from APDA which includes the
- latest software, plust the Addison-Wesley book, plus a disk for CTB 1.1.
- I would also suggest ordering the Basic COnnectivity Set from APDA for
- $50, as well as downloading the Hayes Modem Tool from America Online.
-
- 2- The Addison Wesley book covers things pretty well, and if you want
- some example code, APDA has sample code for sale from a sample CTB based
- terminal program to Tools that handle file xfer, connection, etc.
-
-
- - --
-
- \ | / | Brian Hall mspace@netcom.com
- - : - | Mark/Space Softworks Applelink: markspace
- /|\ | America Online: MarkSpace
- |-+-| |
- /-\|/-\ | People don't kill people, toasters kill people.
-
- ---------------------------
-
- From: mtc@mundil.cs.mu.OZ.AU (Michael Trevor CUTTER)
- Subject: Calling XCMDs from normal code (Pascal particularly!)
- Date: 28 Apr 92 03:12:35 GMT
- Organization: Computer Science, University of Melbourne, Australia
-
- I'd really love to know how to call a code resource from source code, specific-
- ally calling an XCMD from Pascal. Obviously I need to pass it an XCMDPtr, but
- how!!!!
-
- I would be most grateful if someone could point me in the right direction.
-
- Thanks very much,
- Mike Cutter.
-
- +++++++++++++++++++++++++++
-
- From: potts@itl.itd.umich.edu (Paul Potts)
- Organization: Instructional Technology Laboratory, University of Michigan
- Date: Tue, 28 Apr 92 17:27:19 GMT
-
- In article <9211913.11075@mulga.cs.mu.OZ.AU> mtc@mundil.cs.mu.OZ.AU (Michael Trevor CUTTER) writes:
- >I'd really love to know how to call a code resource from source code, specific-
- >ally calling an XCMD from Pascal. Obviously I need to pass it an XCMDPtr, but
- >how!!!!
- >
- >I would be most grateful if someone could point me in the right direction.
-
- There are a couple of approaches. If you have the source code to the XCMD,
- you can add the files to your project and then call it directly by faking it
- out - sending it a phoney XCMDPtr. This won't work if you need to support
- callbacks into Hypercard or windows, but I've added several of my own XCMDs
- to a THINK C project with this method.
-
- If you just have a code resource, it gets harder. You'll have to load the
- resource, set up your XCMD paramblock and pointer and jump to it. You won't
- be able to support callbacks or external windows. Someone else will have
- to offer advice on this part - I've never done it (it sounds a little tricky)...
- >
- >Thanks very much,
- > Mike Cutter.
- >
-
-
- - --
- Paul Potts - potts@itl.itd.umich.edu
- Un damne' descendant sans lampe,/ Au bord d'un gouffre dont l'odeur
- Trahit l'humide profondeur,/ D'e'ternels escaliers sans rampe...
- -Baudelaire on DOS/Windows programming
-
- ---------------------------
-
- End of C.S.M.P. Digest
- **********************
-